<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no"/>
    <title>添加或编辑界面</title>
    <link rel="stylesheet" type="text/css" href="${s.base}/lib/layui/css/layui.css"/>
    <link rel="stylesheet" type="text/css" href="${s.base}/css/base/index.css"/>
    <link rel="stylesheet" type="text/css" href="${s.base}/css/base/theme/theme.css"/>
    <style>
        .w440{
            width: 440px !important;
        }
    </style>
</head>
<body>
<div class="page-content-wrap clearfix">
    <form class="layui-form" id="tool">
        <div class="layui-tab">
            <div class="layui-tab-content">
                <div class="layui-tab-item layui-show">
                    <input type="hidden" name="applyId" id="applyId" value="${wbServicer.applyId}" />
                    <div class="layui-form-item">
                        <label class="layui-form-label"><span class="red">*</span>&nbsp;服务商名称：</label>
                        <div class="layui-input-inline w440">
                            <input type="text" name="name" value="${wbServicer.name}" lay-verify="required" placeholder="请输入服务商名称" autocomplete="off" class="layui-input" maxlength="200">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label"><span class="red">*</span>&nbsp;负责人：</label>
                        <div class="layui-input-inline">
                            <input type="text" name="principal" value="${wbServicer.principal}" lay-verify="required" placeholder="请输入负责人" autocomplete="off" class="layui-input" maxlength="200">
                        </div>
                        <label class="layui-form-label"><span class="red">*</span>&nbsp;联系电话：</label>
                        <div class="layui-input-inline">
                            <input type="text" name="mobile" value="${wbServicer.mobile}" lay-verify="required|number" placeholder="请输入负责人联系电话" autocomplete="off" class="layui-input" maxlength="11">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label"><span class="red">*</span>&nbsp;服务商类型：</label>
                        <div class="layui-input-inline">
                            <select name="type" id="type" lay-verify="required" ></select>
                        </div>
                        <label class="layui-form-label"><span class="red">*</span>&nbsp;座机号：</label>
                        <div class="layui-input-inline">
                            <input type="text" name="phone" value="${wbServicer.mobile}" lay-verify="required|number" placeholder="请输入座机号" autocomplete="off" class="layui-input" maxlength="11">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label"><span class="red">*</span>&nbsp;排序：</label>
                        <div class="layui-input-inline w440">
                            <input type="text" name="sort" value="${wbServicer.sort}" lay-verify="required" placeholder="排序" autocomplete="off" class="layui-input" maxlength="200">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label"><span class="red">*</span>&nbsp;地址：</label>
                        <div class="layui-input-inline w440">
                            <input type="text" name="address" value="${wbServicer.address}" lay-verify="required" placeholder="请输入服务商联系地址" autocomplete="off" class="layui-input" maxlength="200">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label"><span class="red">*</span>&nbsp;备注：</label>
                        <div class="layui-input-inline w440">
                            <input type="text" name="remarks" value="${wbServicer.remarks}" placeholder="请输入备注" autocomplete="off" class="layui-input" maxlength="200">
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <div class="layui-form-item">
            <div class="layui-input-block" style="margin-left: 0px !important;text-align: center">
                <button class="layui-btn layui-btn-normal" lay-submit lay-filter="submitBtn">提交</button>
                <button type="button" id="cancel" class="layui-btn layui-btn-primary">取消</button>
                <button type="button" style="display: none;" id="save" class="layui-btn layui-btn-primary"></button>
            </div>
        </div>
    </form>
</div>
<script src="${s.base}/lib/layui/layui.js" type="text/javascript" charset="utf-8"></script>
<script src="${s.base}/js/common.js" type="text/javascript" charset="utf-8"></script>
<script>
    layui.use(['jquery', 'form', 'baseutil','page'], function () {
        var $ = layui.jquery,
            form = layui.form,
            baseutil = layui.baseutil,
            page=layui.page;
        page.initDict('wbservicertype', function (dictData) {
            page.showDict($("#type"), page.aceeptDictContentList(dictData, 'wbservicertype'), "请选择", '${wbServicer.type}');
        });
        //监听提交
        form.on('submit(submitBtn)', function (data) {
            data.field.id = '${wbServicer.id}';
            baseutil.post("/work/wb/wbservicer/addOrUpdate", data.field, function () {
                $("#save").click();
            });
            return false;
        });
    });
</script>
</body>
</html>